/**
 * \file       xml.h
 * \brief      header file for xml.cpp
 * \version    1.0
 * \author     dragon,chinagnu@gmail.com
 * \date       2008-05-02
 * \remarks    there is initial Version
 * \bug        unknown
 * \todo       header for process xml data
 *
 * <HR>
 * \version    1.1
 * \author     dragon,chinagnu@gmail.com
 * \date       2008-05-06
 * \remarks    modify some funtions defination.
 *
 * <HR>
 * \version    1.2
 * \author     dragon,chinagnu@gmail.com
 * \date       2008-05-08
 * \remarks    remove create_config_file, modify add_dir_into_list
 *
 * <HR>
 * \version    1.3
 * \author     dragon,chinagnu@gmail.com
 * \date       2008-05-09
 * \remarks    update defination of add_dir_to_list and add_file_to_list.
 *
 * <HR>
 * \version    1.4
 * \author     dragon,chinagnu@gmail.com
 * \date       2008-05-15
 * \remarks    add check_list_file and change the attribute of method get_basename
 */

#ifndef    xml_H
#define    xml_H

#include "dragon.h"

/// control and process play list with xml configure file
class XMLProcess
{
private:
	 wxString d_res_dir;
	 uint32_t first_load_flag;
     wxArrayString *media_type;
     void init_media_type(void);

	 wxXmlDocument r_doc;
	 wxXmlDocument w_doc;
	 wxXmlNode* root;

	 uint32_t init_read_handle(wxString conf_file);
	 void init_write_handle(void);
	 wxString get_basename(wxString name);

public:
	 XMLProcess(void);
	 ~XMLProcess(void);
	 wxString get_alias(wxString name);
	 bool check_list_file(wxString filename);
     uint32_t get_media_file(wxString filename);
	 void add_dir_to_list(wxString conf_file,wxArrayString *list,wxArrayString *files);
	 void add_file_to_list(wxString conf_file,wxArrayString *list,wxString filename);

	 wxArrayString* get_records(wxString conf_file);
	 wxXmlNode* create_record(wxString tag,wxString path);

};

#endif
